const express = require('express');
const router = express.Router();
const activityController = require('../controller/activityController.js');
//处理图片上传
const multer = require("multer");
const Activity = multer({dest:"./img/Activity/"});
// 获取活动列表
router.post('/list',activityController.GetActivityList);
// 增加活动
router.post('',Activity.single('file'),activityController.AddActivity);
// 修改活动
router.put('',Activity.single('file'),activityController.EditActivity);
// 删除活动
router.delete('',activityController.DeleteActivity);
// 批量删除公告
router.delete('/BatchDeleteActivity',activityController.BatchDeleteActivity);
// 更新活动发布状态
router.put('/ActivityState',activityController.UpdateActivityState);
// 获取活动详情
router.get('/detail/:id',activityController.GetActivityDetail);

// 获取状态为已发布的活动
router.post('/publish/list',activityController.GetActivityPublishList);
module.exports = router;